package controller;

import dao.DeleteUserDao;

public class DeleteUserController {

    private final DeleteUserDao dao = new DeleteUserDao();

    public String[] getUsers(String username) {
        String[] users1 = dao.getUsers1(username);
        String[] users2 = dao.getUsers2(username);
        String[] users = new String[users1.length + users2.length];
        System.arraycopy(users1, 0, users, 0, users1.length);
        System.arraycopy(users2, 0, users, users1.length, users2.length);
        return users;
    }

    public boolean deleteUser(String username1, String username2) {
        if (dao.checkStatus(username1, username2)) {
            dao.deleteUser(username1, username2);
            dao.update(username1, username2);
            return true;
        }
        return false;
    }
}